<template>
  <div>
    <el-button size="mini" type="primary" :icon="isView ? 'el-icon-edit' : 'el-icon-more'" @click="to" />
    <eForm ref="form" :sup_this="sup_this" :is-add="false" :is-view="isView ? true : false"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    isView: {
      type: Boolean,
      required: true
    },
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = {
        id: this.data.id,
        customerCode: this.data.customerCode,
        classificationId: this.data.classificationId,
        classificationItemName: this.data.classificationItemName,
        industryId: this.data.industryId,
        industryItemName: this.data.industryItemName,
        customerAbbrev: this.data.customerAbbrev,
        customerName: this.data.customerName,
        postalCode: this.data.postalCode,
        address: this.data.address,
        contact: this.data.contact,
        email: this.data.email,
        phone: this.data.phone,
        companyItemId: this.data.companyItemId,
        companyItemName: this.data.companyItemName,
        registeredCapital: this.data.registeredCapital,
        head: this.data.head,
        area: this.data.area,
        latitude: this.data.latitude,
        longtitude: this.data.longtitude,
        serviceContent: this.data.serviceContent,
        state: this.data.state
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
